/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.app.course.study.entity;

import java.math.BigDecimal;
import java.time.LocalDateTime;

import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.BaseEntity;
import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.modules.zx.course.entity.Tcourses;

/**
 * 课程学习表Entity
 * @author zpp
 * @version 2020-01-26
 */
@Table(name="t_course_study", alias="a", columns={
		@Column(name="id", attrName="id", label="主键", isPK=true),
		@Column(name="course_id", attrName="courseId", label="课程主键"),
		@Column(name="course_hourse_id", attrName="courseHourseId", label="课程主键"),		
		@Column(name="user_id", attrName="userId", label="用户主键"),
		@Column(name="duration", attrName="duration", label="用户主键"),
		@Column(name="play_date", attrName="playDate", label="用户主键"),
		@Column(name="pause_date", attrName="pauseDate", label="用户主键"),
		@Column(name="difference", attrName="difference", label="用户主键"),
		@Column(name="pause_time", attrName="pauseTime", label="用户主键"),
		@Column(name="finish", attrName="finish", label="是否学完课时"),
		@Column(includeEntity=DataEntity.class),
	},joinTable={
		@JoinTable(type=Type.JOIN,alias = "c", entity = Tcourses.class, on = "a.course_id=c.id",attrName="course",columns={
			@Column(includeEntity=Tcourses.class),
		})	
	}, orderBy="a.update_date DESC"
)
public class TcourseStudy extends DataEntity<TcourseStudy> {
	
	private static final long serialVersionUID = 1L;
	private String courseId;		// 课程主键
	private String userId;		// 用户主键
	private Tcourses course=new Tcourses();//课程对象
	private String courseHourseId;
	private BigDecimal duration;
	private LocalDateTime playDate;
	private LocalDateTime pauseDate;
	private String difference;
	private BigDecimal pauseTime;
	private Integer finish;
	
	public Integer getFinish() {
		return finish;
	}

	public void setFinish(Integer finish) {
		this.finish = finish;
	}

	public BigDecimal getPauseTime() {
		return pauseTime;
	}

	public void setPauseTime(BigDecimal pauseTime) {
		this.pauseTime = pauseTime;
	}

	public String getDifference() {
		return difference;
	}

	public void setDifference(String difference) {
		this.difference = difference;
	}

	public BigDecimal getDuration() {
		return duration;
	}

	public void setDuration(BigDecimal duration) {
		this.duration = duration;
	}

	public LocalDateTime getPlayDate() {
		return playDate;
	}

	public void setPlayDate(LocalDateTime playDate) {
		this.playDate = playDate;
	}

	public LocalDateTime getPauseDate() {
		return pauseDate;
	}

	public void setPauseDate(LocalDateTime pauseDate) {
		this.pauseDate = pauseDate;
	}

	public String getCourseHourseId() {
		return courseHourseId;
	}

	public void setCourseHourseId(String courseHourseId) {
		this.courseHourseId = courseHourseId;
	}

	public Tcourses getCourse() {
		return course;
	}

	public void setCourse(Tcourses course) {
		this.course = course;
	}

	public TcourseStudy() {
		this(null);
	}

	public TcourseStudy(String id){
		super(id);
	}
	
	@Length(min=0, max=50, message="课程主键长度不能超过 50 个字符")
	public String getCourseId() {
		return courseId;
	}

	public void setCourseId(String courseId) {
		this.courseId = courseId;
	}
	
	@Length(min=0, max=64, message="用户主键长度不能超过 64 个字符")
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}
	
}